package com.example.tests;

public class ContactData implements Comparable<ContactData>
{
	private String id;
	private String firstname;
	private String lastname;
	private String address;
	private String phoneHome;
	private String phoneMobile;
	private String phoneWork;
	private String email1;
	private String email2;
	private String bday;
	private String bmonth;
	private String byear;
	private String group;
	private String address2;
	private String phone2;

	public ContactData()
	{

	}

	public ContactData(String firstname, String lastname, String address, String phoneHome, String phoneMobile, String phoneWork, String email1, String email2,
			String bday, String bmonth, String byear, String group, String address2, String phone2)
	{
		this.firstname = firstname;
		this.lastname = lastname;
		this.address = address;
		this.phoneHome = phoneHome;
		this.phoneMobile = phoneMobile;
		this.phoneWork = phoneWork;
		this.email1 = email1;
		this.email2 = email2;
		this.bday = bday;
		this.bmonth = bmonth;
		this.byear = byear;
		this.group = group;
		this.address2 = address2;
		this.phone2 = phone2;
	}

	@Override
	public String toString()
	{
		return "ContactData [lastname=" + lastname + "]";
	}

	@Override
	public int hashCode()
	{
		// final int prime = 31;
		int result = 1;
		// result = prime * result + ((lastname == null) ? 0 : lastname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (lastname == null)
		{
			if (other.lastname != null)
				return false;
		}
		else if (!lastname.equals(other.lastname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other)
	{
		return this.lastname.toLowerCase().compareTo(other.lastname.toLowerCase());
	}

	public ContactData withId(String id)
	{
		setId(id);
		return this;
	}

	public ContactData withFirstname(String firstname)
	{
		setFirstname(firstname);
		return this;
	}

	public ContactData withLastname(String lastname)
	{
		setLastname(lastname);
		return this;
	}

	public ContactData withAddress(String address)
	{
		setAddress(address);
		return this;
	}

	public ContactData withPhoneHome(String phoneHome)
	{
		setPhoneHome(phoneHome);
		return this;
	}

	public ContactData withPhoneMobile(String phoneMobile)
	{
		setPhoneMobile(phoneMobile);
		return this;
	}

	public ContactData withPhoneWork(String phoneWork)
	{
		setPhoneWork(phoneWork);
		return this;
	}

	public ContactData withEmail1(String email1)
	{
		setEmail1(email1);
		return this;
	}

	public ContactData withEmail2(String email2)
	{
		setEmail2(email2);
		return this;
	}

	public ContactData withBday(String bday)
	{
		setBday(bday);
		return this;
	}

	public ContactData withBmonth(String bmonth)
	{
		setBmonth(bmonth);
		return this;
	}

	public ContactData withByear(String byear)
	{
		setByear(byear);
		return this;
	}

	public ContactData withGroup(String group)
	{
		setGroup(group);
		return this;
	}

	public ContactData withAddress2(String address2)
	{
		setAddress2(address2);
		return this;
	}

	public ContactData withPhone2(String phone2)
	{
		setPhone2(phone2);
		return this;
	}

	public String getId()
	{
		return id;
	}

	public String getFirstname()
	{
		return firstname;
	}

	public String getLastname()
	{
		return lastname;
	}

	public String getAddress()
	{
		return address;
	}

	public String getPhoneHome()
	{
		return phoneHome;
	}

	public String getPhoneMobile()
	{
		return phoneMobile;
	}

	public String getPhoneWork()
	{
		return phoneWork;
	}

	public String getEmail1()
	{
		return email1;
	}

	public String getEmail2()
	{
		return email2;
	}

	public String getBday()
	{
		return bday;
	}

	public String getBmonth()
	{
		return bmonth;
	}

	public String getByear()
	{
		return byear;
	}

	public String getGroup()
	{
		return group;
	}

	public String getAddress2()
	{
		return address2;
	}

	public String getPhone2()
	{
		return phone2;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public void setFirstname(String firstname)
	{
		this.firstname = firstname;
	}

	public void setLastname(String lastname)
	{
		this.lastname = lastname;
	}

	public void setAddress(String address)
	{
		this.address = address;
	}

	public void setPhoneHome(String phoneHome)
	{
		this.phoneHome = phoneHome;
	}

	public void setPhoneMobile(String phoneMobile)
	{
		this.phoneMobile = phoneMobile;
	}

	public void setPhoneWork(String phoneWork)
	{
		this.phoneWork = phoneWork;
	}

	public void setEmail1(String email1)
	{
		this.email1 = email1;
	}

	public void setEmail2(String email2)
	{
		this.email2 = email2;
	}

	public void setBday(String bday)
	{
		this.bday = bday;
	}

	public void setBmonth(String bmonth)
	{
		this.bmonth = bmonth;
	}

	public void setByear(String byear)
	{
		this.byear = byear;
	}

	public void setGroup(String group)
	{
		this.group = group;
	}

	public void setAddress2(String address2)
	{
		this.address2 = address2;
	}

	public void setPhone2(String phone2)
	{
		this.phone2 = phone2;
	}

}